var local="http://47.104.10.151";
function Order_com() {
    var use_id=1;
    var xmlHttp;
    xmlHttp=CreatXMLHTTP();
    var txt=""
    txt="order_id="+use_id;
    var url=local+":8080/stockorder/orderChangeTo3";//服务器URL
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
            var result = xmlHttp.responseText;
            var json = eval("(" + result + ")");

            var msg=json.msg;
            alert("订单状态为:"+msg);
        }
    }
}

function CreatXMLHTTP() {
    //使用大部分浏览器
    var xmlHttp;
    if(window.XMLHttpRequest){
        xmlHttp=new XMLHttpRequest();
    }
    if(window.ActiveXObject){
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        if(!xmlHttp){
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
    }
    return xmlHttp;
}
